d/p/pull-Correctly-handle-repo-parent_repo-when-applying-stat.patch: apply patch...
authorSimon McVittie <smcv@debian.org>
Sun, 26 Jun 2016 11:32:22 +0000 (12:32 +0100)
committerSimon McVittie <smcv@debian.org>
Sun, 26 Jun 2016 11:32:22 +0000 (12:32 +0100)
debian/changelog
debian/patches/pull-Correctly-handle-repo-parent_repo-when-applying-stat.patch [new file with mode: 0644]
debian/patches/series

index 0d66baf5551a73a4f1b500ab5f34d0d4a18d3efa..97a50e22a0915cab25e6e67fba268a4df5186832 100644 (file)
@@ -12,6 +12,9 @@ ostree (2016.6-1) UNRELEASED; urgency=medium
     (add https://github.com/ostreedev/ostree as a remote)
   * d/p/libostree.sym-Fix-test-symbols.patch: apply patch from upstream
     to fix a build-time test
+  * d/p/pull-Correctly-handle-repo-parent_repo-when-applying-stat.patch:
+    apply patch from upstream to fix a bug that flatpak currently works
+    around
 
  -- Simon McVittie <smcv@debian.org>  Wed, 15 Jun 2016 14:05:53 -0400
 
diff --git a/debian/patches/pull-Correctly-handle-repo-parent_repo-when-applying-stat.patch b/debian/patches/pull-Correctly-handle-repo-parent_repo-when-applying-stat.patch
new file mode 100644 (file)
index 0000000..62de025
--- /dev/null
@@ -0,0 +1,57 @@
+From: Alexander Larsson <alexl@redhat.com>
+Date: Thu, 23 Jun 2016 11:51:15 +0200
+Subject: pull: Correctly handle repo->parent_repo when applying static deltas
+
+In flatpak i was using a parent repo, and it failed to update
+with ENOENT when dispatching an set-read-source opcode, because the
+object it referenced was in the parent repo.
+
+This fixes that by making _ostree_repo_read_bare_fd look
+at parent_repo.
+
+Closes: #362
+Approved by: cgwalters
+Origin: upstream, 2016.7, commit:fc4a7ec35e6e7a3a2db80257508faa592329786c
+---
+ src/libostree/ostree-repo.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
+index e86685b..b835348 100644
+--- a/src/libostree/ostree-repo.c
++++ b/src/libostree/ostree-repo.c
+@@ -2715,18 +2715,29 @@ _ostree_repo_read_bare_fd (OstreeRepo           *self,
+                            GError             **error)
+ {
+   char loose_path_buf[_OSTREE_LOOSE_PATH_MAX];
+-  
++
+   g_assert (self->mode == OSTREE_REPO_MODE_BARE ||
+             self->mode == OSTREE_REPO_MODE_BARE_USER);
+   _ostree_loose_path (loose_path_buf, checksum, OSTREE_OBJECT_TYPE_FILE, self->mode);
+-  
+-  *out_fd = openat (self->objects_dir_fd, loose_path_buf, O_RDONLY | O_CLOEXEC);
+-  if (*out_fd < 0)
++
++  if (!ot_openat_ignore_enoent (self->objects_dir_fd, loose_path_buf, out_fd, error))
++    return FALSE;
++
++  if (*out_fd == -1)
+     {
+-      glnx_set_error_from_errno (error);
++      if (self->parent_repo)
++        return _ostree_repo_read_bare_fd (self->parent_repo,
++                                          checksum,
++                                          out_fd,
++                                          cancellable,
++                                          error);
++
++      g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
++                   "No such file object %s", checksum);
+       return FALSE;
+     }
++
+   return TRUE;
+ }
index a185cd6c3513787b4b504886c13a321b35f3ad41..ccc855066d5e9af5ff20fd5f8056e23adb6f7c43 100644 (file)
@@ -1 +1,2 @@
 libostree.sym-Fix-test-symbols.patch
+pull-Correctly-handle-repo-parent_repo-when-applying-stat.patch